pkg_name=mplayer
date=2015-04-07
src_dir=$src_dir_root/$pkg_name-export-$date
archive_name=$pkg_name-export-snapshot.tar.bz2
url=https://www.mplayerhq.hu/MPlayer/releases/$archive_name

cd "$src_dir_root"
rm -Rf "$src_dir"
tar jxf "$archive_name"

cd "$src_dir"

cp -f "$builders_dir_root/$pkg_name/Makefile.patch" ./
patch -N -i ./Makefile.patch
cd "./libmpcodecs"
cp -f "$builders_dir_root/$pkg_name/libmpcodecs-ad.c.patch" ./
patch -N -i ./libmpcodecs-ad.c.patch

cd "$src_dir"

#you must leave many settings to "auto" or pkg-config won't be 
#use to setup proper compilation and linking
"./configure"				\
	"--extra-cflags=-O0 -I/include"	\
	--prefix=			\
	--disable-mencoder		\
	--disable-gui			\
	--enable-iconv			\
	--disable-langinfo		\
	--disable-lirc			\
	--disable-lircc			\
	--disable-joystick		\
	--disable-apple-remote		\
	--disable-apple-ir		\
	--disable-vm			\
	--disable-xf86keysym		\
	--disable-radio			\
	--disable-radio-capture		\
	--disable-radio-v4l2		\
	--disable-radio-bsdbt848	\
	--enable-tv			\
	--disable-tv-v4l1		\
	--enable-tv-v4l2		\
	--disable-tv-bsdbt848		\
	--disable-pvr			\
	--enable-rtc			\
	--disable-networking		\
	--disable-winsock2_h		\
	--disable-smb			\
	--disable-live			\
	--disable-nemesi		\
	--disable-librtmp		\
	--disable-vcd			\
	--disable-bluray		\
	--disable-dvdnav		\
	--disable-dvdread		\
	--disable-cdparanoia		\
	--disable-cddb			\
	--disable-bitmap-font		\
	--disable-unrarexec		\
	--enable-menu			\
	--enable-sortsub		\
	--disable-enca			\
	--disable-maemo			\
	--disable-macosx-finder		\
	--disable-macosx-bundle		\
	--disable-inet6			\
	--disable-sctp			\
	--disable-gethostbyname2	\
	--disable-ftp			\
	--disable-vstream		\
	--disable-w32threads		\
	--disable-os2threads		\
	--disable-ass-internal		\
	--disable-rpath			\
	--disable-gnutls		\
\
	--disable-gif			\
	--disable-png			\
	--disable-mng			\
	--disable-jpeg			\
	--disable-libcdio		\
	--disable-liblzo		\
	--disable-win32dll		\
	--disable-qtx			\
	--disable-xanim			\
	--disable-real			\
	--disable-xvid			\
	--disable-xvid-lavc		\
	--disable-x264			\
	--disable-x264-lavc		\
	--disable-libdirac-lavc		\
	--disable-libschroedinger-lavc	\
	--disable-libvpx-lavc		\
	--disable-libnut		\
	--disable-ffmpeg_a		\
	--disable-vf-lavfi		\
	--disable-libavcodec_mpegaudio_hp	\
	--disable-tremor		\
	--disable-libvorbis		\
	--disable-speex 		\
	--disable-libgsm		\
	--disable-theora		\
	--disable-faad			\
	--disable-faac			\
	--disable-faac-lavc		\
	--disable-ladspa		\
	--disable-libbs2b		\
	--disable-libdv			\
	--disable-libilbc		\
	--disable-libopus		\
	--disable-mpg123		\
	--disable-mad			\
	--disable-mp3lame		\
	--disable-mp3lame-lavc		\
	--disable-toolame		\
	--disable-twolame		\
	--disable-xmms			\
	--disable-libdca		\
	--disable-liba52		\
	--disable-libmpeg2		\
	--disable-libmpeg2-internal	\
	--disable-musepack		\
	--disable-libopencore_amrnb	\
	--disable-libopencore_amrwb	\
	--disable-libopenjpeg		\
	--disable-crystalhd		\
\
	--disable-vidix			\
	--disable-vidix-pcidb		\
	--disable-dhahelper		\
	--disable-svgalib_helper	\
	--disable-gl			\
	--disable-matrixview		\
	--disable-dga2			\
	--disable-dga1			\
	--disable-vesa			\
	--disable-svga			\
	--disable-sdl			\
	--disable-kva			\
	--disable-aa			\
	--disable-caca			\
	--disable-ggi			\
	--disable-ggiwmh		\
	--disable-direct3d		\
	--disable-directx		\
	--disable-dxr2			\
	--disable-dxr3			\
	--disable-ivtv			\
	--disable-v4l2			\
	--disable-dvb			\
	--disable-mga			\
	--disable-xmga			\
	--disable-xv			\
	--disable-xvmc			\
	--disable-vda			\
	--disable-vdpau			\
	--disable-vm			\
	--disable-fbdev			\
	--disable-mlib			\
	--disable-3dfx			\
	--disable-tdfxfb		\
	--disable-s3fb			\
	--disable-wii			\
	--disable-directfb		\
	--disable-zr			\
	--disable-bl			\
	--disable-tdfxvid		\
	--disable-xvr100		\
	--disable-tga			\
	--disable-pnm			\
	--disable-md5sum		\
	--disable-yuv4mpeg		\
	--disable-corevideo		\
	--disable-quartz		\
\
	--disable-ossaudio		\
	--disable-arts			\
	--disable-esd			\
	--disable-pulse			\
	--disable-jack			\
	--disable-openal		\
	--disable-nas			\
	--disable-sgiaudio		\
	--disable-sndio			\
	--disable-sunaudio		\
	--disable-kai			\
	--disable-dart			\
	--disable-win32waveout		\
	--disable-coreaudio 		\
	--disable-select		\
\
	--enable-runtime-cpudetection	\
	--disable-static
	

make

install_tmp_dir=/tmp/$pkg_name-$date
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

rm -Rf "$install_tmp_dir"
rm -Rf "$src_dir"
